﻿using System;
using System.Threading;
using System.Threading.Tasks;


namespace Chappter1_9
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            Task<int> t = Task.Run(() => {
                for (int i = 0; i < 10; i++)
                {
                    Console.WriteLine("Task Proc {0}", i);
                    Thread.Sleep(1000);
                }
                return 42;
            });
            Console.WriteLine(t.Result);
            Console.ReadLine(); 
        }
    }
}
